Skip to content

Conversation

@michelroegl-brunner
Copy link
Member

Problem

Scripts downloaded to directories other than scripts/ct/ were not being detected and shown in the Downloaded Scripts tab. The Available Scripts tab also showed incorrect download status for scripts in tools/, vm/, and vw/ directories.

Solution

  • Added getAllDownloadedScripts() method to ScriptManager class that scans all script directories (ct, tools, vm, vw)
  • Added recursive directory scanning to handle subdirectories like tools/pve/
  • Updated DownloadedScriptsTab to use the new API endpoint
  • Updated ScriptsGrid to use the new API endpoint for download status detection
  • Updated main page script counts to use the new API endpoint
  • Maintained backward compatibility with existing getCtScripts endpoint

Changes

  • src/server/lib/scripts.ts: Added getAllDownloadedScripts() and recursive getScriptsFromDirectory() methods
  • src/server/api/routers/scripts.ts: Added getAllDownloadedScripts API endpoint
  • src/app/page.tsx: Updated to use new API for script counts
  • src/app/_components/DownloadedScriptsTab.tsx: Updated to use new API endpoint
  • src/app/_components/ScriptsGrid.tsx: Updated to use new API endpoint

Testing

  • Verified API returns scripts from all directories (ct, tools, vm, vw)
  • Confirmed Downloaded Scripts tab shows all downloaded scripts
  • Confirmed Available Scripts tab shows correct download status
  • Maintained backward compatibility with existing functionality

Fixes the issue where scripts downloaded to non-ct directories were not properly tracked or displayed.

- Add getAllDownloadedScripts() method to scan all script directories
- Update DownloadedScriptsTab to use new API endpoint
- Update ScriptsGrid to use new API endpoint for download status detection
- Update main page script counts to use new API endpoint
- Add recursive directory scanning to handle subdirectories
- Maintain backward compatibility with existing getCtScripts endpoint

Fixes issue where scripts downloaded to tools/, vm/, or vw/ directories
were not showing in Downloaded Scripts tab or showing correct download
status in Available Scripts tab.
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner October 13, 2025 11:33
- Remove redundant string type annotation from relativePath parameter
- Fix getScriptsFromDirectory method call to match updated signature
@michelroegl-brunner michelroegl-brunner merged commit 9d83697 into main Oct 13, 2025
4 checks passed
@michelroegl-brunner michelroegl-brunner changed the title Fix: Detect downloaded scripts from all directories (ct, tools, vm, vw) Fix: Detect downloaded scripts from all directories (ct, tools, vm) Oct 13, 2025
@michelroegl-brunner michelroegl-brunner deleted the fix/addons_vms_tools_notshown branch October 14, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants